/* 现代化主题样式 - 风力发电叶片缺陷检测系统 */
:root{
    /* 颜色系统 */
    --bg: #f5f8fc;
    --surface: #ffffff;
    --surface-hover: #f9fafb;
    --muted: #6b7280;
    --text: #0f1724;
    --text-secondary: #64748b;
    --primary: #0f63ff;
    --primary-hover: #0b52d6;
    --primary-600: #0b4bd6;
    --accent: #06b6d4;
    --accent-hover: #0891b2;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;
  
    /* 圆角 */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* 阴影 */
    --shadow-xs: 0 1px 2px rgba(15,23,42,0.05);
    --shadow-sm: 0 2px 8px rgba(15,23,42,0.06);
    --shadow-md: 0 4px 16px rgba(15,23,42,0.08);
    --shadow-lg: 0 8px 24px rgba(15,23,42,0.1);
    --shadow-xl: 0 16px 48px rgba(15,23,42,0.12);
    --shadow-primary: 0 8px 24px rgba(15,99,255,0.2);
  
    /* 间距 */
    --space-xs: 6px;
    --space-sm: 12px;
    --space-md: 20px;
    --space-lg: 32px;
    --space-xl: 48px;
  
    /* 字体 */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    --base-font-size: 14px;
    
    /* 过渡 */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基础样式 */
*{
    box-sizing:border-box;
    margin: 0;
    padding: 0;
}

html,body,#root{
    height:100%;
    margin:0;
}

body{
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    color:var(--text);
    font-family:var(--font-sans);
    font-size:var(--base-font-size);
    -webkit-font-smoothing:antialiased;
    -moz-osx-font-smoothing:grayscale;
    line-height:1.6;
    overflow-x: hidden;
}

/* 顶部导航栏 */
.app-header {
    height:70px;
    display:flex;
    align-items:center;
    justify-content: space-between;
    gap:16px;
    padding:0 32px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: var(--text);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    position:sticky;
    top:0;
    z-index:1000;
    transition: all var(--transition-base);
}

.app-header:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.app-header .logo {
    display:flex;
    align-items:center;
    gap:12px;
    font-weight:700;
    font-size:18px;
    color: var(--primary);
    transition: transform var(--transition-fast);
}

.app-header .logo:hover {
    transform: scale(1.05);
}

.logo-badge{
    width:48px;
    height:48px;
    border-radius:12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:800;
    font-size: 20px;
    color:white;
    box-shadow: var(--shadow-primary);
    transition: all var(--transition-base);
}

.logo-badge:hover {
    transform: rotate(5deg) scale(1.1);
    box-shadow: 0 12px 32px rgba(15,99,255,0.3);
}

/* 导航链接 */
nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

nav a {
    padding: 10px 20px;
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

nav a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: all var(--transition-base);
    transform: translateX(-50%);
}

nav a:hover {
    color: var(--primary);
    background: var(--info-light);
}

nav a:hover::before {
    width: 80%;
}

nav a.active {
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-600));
    box-shadow: var(--shadow-primary);
}

/* 容器布局 */
.container { 
    max-width:1280px; 
    margin:0 auto; 
    padding: 32px 24px;
    background:transparent; 
}

.page { 
    padding-top:24px;
    animation: fadeInUp var(--transition-slow);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    border: 1px solid rgba(0,0,0,0.05);
}

.card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

.card-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--bg);
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width var(--transition-base), height var(--transition-base);
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:active {
    transform: scale(0.96);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-600));
    color: white;
    box-shadow: var(--shadow-primary);
}

.btn.primary:hover {
    box-shadow: 0 12px 32px rgba(15,99,255,0.3);
    transform: translateY(-2px);
}

.btn.secondary {
    background: var(--surface);
    color: var(--text);
    border: 2px solid var(--primary);
}

.btn.secondary:hover {
    background: var(--primary);
    color: white;
}

.btn.success {
    background: var(--success);
    color: white;
}

.btn.danger {
    background: var(--danger);
    color: white;
}

.btn.sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn.lg {
    padding: 16px 32px;
    font-size: 16px;
}

/* 输入框样式 */
input, textarea, select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: var(--font-sans);
    transition: all var(--transition-fast);
    background: white;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(15,99,255,0.1);
}

input:hover, textarea:hover, select:hover {
    border-color: var(--primary-hover);
}

.search-input {
    padding-left: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
}

/* 图片网格 */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.image-item {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    cursor: pointer;
}

.image-item:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-8px);
}

.image-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.image-item:hover img {
    transform: scale(1.1);
}

.image-info {
    padding: 16px;
}

.image-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

/* 标签样式 */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.badge.success {
    background: var(--success-light);
    color: var(--success);
}

.badge.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge.danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge.info {
    background: var(--info-light);
    color: var(--info);
}

/* 聊天窗口 */
.chat-window {
    max-height: 500px;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.chat-window::-webkit-scrollbar {
    width: 8px;
}

.chat-window::-webkit-scrollbar-track {
    background: transparent;
}

.chat-window::-webkit-scrollbar-thumb {
    background: var(--muted);
    border-radius: var(--radius-full);
}

.chat-window::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.message {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    max-width: 80%;
    animation: slideIn var(--transition-base);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.message.user {
    background: linear-gradient(135deg, var(--primary), var(--primary-600));
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
    box-shadow: var(--shadow-md);
}

.message.bot {
    background: white;
    color: var(--text);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-sm);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

th, td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--bg);
}

th {
    background: var(--bg);
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

tr:hover {
    background: var(--surface-hover);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .app-header {
        padding: 0 16px;
        height: 60px;
    }
    
    .container {
        padding: 20px 16px;
    }
    
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }
    
    .card {
        padding: 20px;
    }
    
    nav {
        flex-wrap: wrap;
    }
    
    nav a {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* 工具提示 */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    background: var(--text);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-fast);
}

.tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* 页面标题 */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 16px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
}

h1 {
    font-size: 32px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 24px;
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

/* 通知提示 */
.notification {
    position: fixed;
    top: 90px;
    right: 20px;
    padding: 16px 20px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    z-index: 2000;
    animation: slideInRight var(--transition-base);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}

.empty-state svg {
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* 分隔线 */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--muted), transparent);
    margin: 32px 0;
}